﻿// AUTOMATICALLY GENERATED CODE

using System;
using System.Collections.Generic;
using Sce.PlayStation.Core;
using Sce.PlayStation.Core.Imaging;
using Sce.PlayStation.Core.Environment;
using Sce.PlayStation.HighLevel.UI;

namespace Nyanimals_UI
{
    partial class NyanimalDisplay
    {
        Label StatsLabel;
        Label NameLabel;
        
        Label HungerLabel;
        ProgressBar HungerBar;
        Label HungerPercentLabel;
        
        Label StaminaPercentLabel;
        ProgressBar StaminaBar;
        Label StaminaLabel;
        
        Label RunningPercentLabel;
        ProgressBar RunningBar;
        Label RunLabel;
        
        Panel Display_Panel;

        private void InitializeWidget()
        {
            InitializeWidget(LayoutOrientation.Horizontal);
        }

        private void InitializeWidget(LayoutOrientation orientation)
        {
            StatsLabel = new Label();
            StatsLabel.Name = "StatsLabel";
            NameLabel = new Label();
            NameLabel.Name = "NameLabel";
            HungerLabel = new Label();
            HungerLabel.Name = "HungerLabel";
            HungerBar = new ProgressBar();
            HungerBar.Name = "HungerBar";
            HungerPercentLabel = new Label();
            HungerPercentLabel.Name = "HungerPercentLabel";
            StaminaPercentLabel = new Label();
            StaminaPercentLabel.Name = "StaminaPercentLabel";
            StaminaBar = new ProgressBar();
            StaminaBar.Name = "StaminaBar";
            StaminaLabel = new Label();
            StaminaLabel.Name = "StaminaLabel";
            RunningPercentLabel = new Label();
            RunningPercentLabel.Name = "RunningPercentLabel";
            RunningBar = new ProgressBar();
            RunningBar.Name = "RunningBar";
            RunLabel = new Label();
            RunLabel.Name = "RunLabel";
            Display_Panel = new Panel();
            Display_Panel.Name = "Display_Panel";

            // StatsLabel
            StatsLabel.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
            StatsLabel.Font = new UIFont(FontAlias.System, 30, FontStyle.Bold | FontStyle.Italic);
            StatsLabel.LineBreak = LineBreak.Character;
            StatsLabel.HorizontalAlignment = HorizontalAlignment.Center;
            StatsLabel.TextShadow = new TextShadowSettings()
            {
                Color = new UIColor(128f / 255f, 128f / 255f, 128f / 255f, 127f / 255f),
                HorizontalOffset = 2f,
                VerticalOffset = 2f,
            };

            // NameLabel
            NameLabel.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
            NameLabel.Font = new UIFont(FontAlias.System, 25, FontStyle.Bold);
            NameLabel.LineBreak = LineBreak.Character;
            NameLabel.VerticalAlignment = VerticalAlignment.Top;

            // HungerLabel
            HungerLabel.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
            HungerLabel.Font = new UIFont(FontAlias.System, 25, FontStyle.Bold);
            HungerLabel.LineBreak = LineBreak.Character;
            HungerLabel.HorizontalAlignment = HorizontalAlignment.Right;

            // HungerPercentLabel
            HungerPercentLabel.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
            HungerPercentLabel.Font = new UIFont(FontAlias.System, 10, FontStyle.Bold);
            HungerPercentLabel.LineBreak = LineBreak.Character;
            HungerPercentLabel.HorizontalAlignment = HorizontalAlignment.Center;

            // StaminaPercentLabel
            StaminaPercentLabel.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
            StaminaPercentLabel.Font = new UIFont(FontAlias.System, 10, FontStyle.Bold);
            StaminaPercentLabel.LineBreak = LineBreak.Character;
            StaminaPercentLabel.HorizontalAlignment = HorizontalAlignment.Center;

            // StaminaLabel
            StaminaLabel.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
            StaminaLabel.Font = new UIFont(FontAlias.System, 25, FontStyle.Bold);
            StaminaLabel.LineBreak = LineBreak.Character;
            StaminaLabel.HorizontalAlignment = HorizontalAlignment.Right;

            // RunningPercentLabel
            RunningPercentLabel.TextColor = new UIColor(255f / 255f, 255f / 255f, 255f / 255f, 255f / 255f);
            RunningPercentLabel.Font = new UIFont(FontAlias.System, 10, FontStyle.Bold);
            RunningPercentLabel.LineBreak = LineBreak.Character;
            RunningPercentLabel.HorizontalAlignment = HorizontalAlignment.Center;

            // RunLabel
            RunLabel.TextColor = new UIColor(0f / 255f, 0f / 255f, 0f / 255f, 255f / 255f);
            RunLabel.Font = new UIFont(FontAlias.System, 25, FontStyle.Bold);
            RunLabel.LineBreak = LineBreak.Character;
            RunLabel.HorizontalAlignment = HorizontalAlignment.Right;

            // Display_Panel
            Display_Panel.BackgroundColor = new UIColor(0f / 255f, 0f / 255f, 255f / 255f, 178f / 255f);
            Display_Panel.Clip = true;
            Display_Panel.AddChildLast(StatsLabel);
            Display_Panel.AddChildLast(NameLabel);
            Display_Panel.AddChildLast(HungerLabel);
            Display_Panel.AddChildLast(HungerBar);
            Display_Panel.AddChildLast(HungerPercentLabel);
            Display_Panel.AddChildLast(StaminaPercentLabel);
            Display_Panel.AddChildLast(StaminaBar);
            Display_Panel.AddChildLast(StaminaLabel);
            Display_Panel.AddChildLast(RunningPercentLabel);
            Display_Panel.AddChildLast(RunningBar);
            Display_Panel.AddChildLast(RunLabel);

            // NyanimalDisplay
            this.RootWidget.AddChildLast(Display_Panel);
            this.Showing += new EventHandler(onShowing);
            this.Shown += new EventHandler(onShown);

            SetWidgetLayout(orientation);

            UpdateLanguage();
        }

        private LayoutOrientation _currentLayoutOrientation;
        public void SetWidgetLayout(LayoutOrientation orientation)
        {
            switch (orientation)
            {
                case LayoutOrientation.Vertical:
                    this.DesignWidth = 544;
                    this.DesignHeight = 960;

                    StatsLabel.SetPosition(-39, 37);
                    StatsLabel.SetSize(214, 36);
                    StatsLabel.Anchors = Anchors.None;
                    StatsLabel.Visible = true;

                    NameLabel.SetPosition(22, 95);
                    NameLabel.SetSize(214, 36);
                    NameLabel.Anchors = Anchors.None;
                    NameLabel.Visible = true;

                    HungerLabel.SetPosition(2, 75);
                    HungerLabel.SetSize(214, 36);
                    HungerLabel.Anchors = Anchors.None;
                    HungerLabel.Visible = true;

                    HungerBar.SetPosition(66, 171);
                    HungerBar.SetSize(362, 16);
                    HungerBar.Anchors = Anchors.Height;
                    HungerBar.Visible = true;

                    HungerPercentLabel.SetPosition(126, 140);
                    HungerPercentLabel.SetSize(214, 36);
                    HungerPercentLabel.Anchors = Anchors.None;
                    HungerPercentLabel.Visible = true;

                    StaminaPercentLabel.SetPosition(106, 120);
                    StaminaPercentLabel.SetSize(214, 36);
                    StaminaPercentLabel.Anchors = Anchors.None;
                    StaminaPercentLabel.Visible = true;

                    StaminaBar.SetPosition(46, 151);
                    StaminaBar.SetSize(362, 16);
                    StaminaBar.Anchors = Anchors.Height;
                    StaminaBar.Visible = true;

                    StaminaLabel.SetPosition(2, 75);
                    StaminaLabel.SetSize(214, 36);
                    StaminaLabel.Anchors = Anchors.None;
                    StaminaLabel.Visible = true;

                    RunningPercentLabel.SetPosition(106, 120);
                    RunningPercentLabel.SetSize(214, 36);
                    RunningPercentLabel.Anchors = Anchors.None;
                    RunningPercentLabel.Visible = true;

                    RunningBar.SetPosition(46, 151);
                    RunningBar.SetSize(362, 16);
                    RunningBar.Anchors = Anchors.Height;
                    RunningBar.Visible = true;

                    RunLabel.SetPosition(2, 75);
                    RunLabel.SetSize(214, 36);
                    RunLabel.Anchors = Anchors.None;
                    RunLabel.Visible = true;

                    Display_Panel.SetPosition(0, -9);
                    Display_Panel.SetSize(100, 100);
                    Display_Panel.Anchors = Anchors.None;
                    Display_Panel.Visible = true;

                    break;

                default:
                    this.DesignWidth = 960;
                    this.DesignHeight = 544;

                    StatsLabel.SetPosition(120, 19);
                    StatsLabel.SetSize(100, 40);
                    StatsLabel.Anchors = Anchors.None;
                    StatsLabel.Visible = true;

                    NameLabel.SetPosition(20, 79);
                    NameLabel.SetSize(300, 40);
                    NameLabel.Anchors = Anchors.None;
                    NameLabel.Visible = true;

                    HungerLabel.SetPosition(0, 140);
                    HungerLabel.SetSize(126, 40);
                    HungerLabel.Anchors = Anchors.None;
                    HungerLabel.Visible = true;

                    HungerBar.SetPosition(126, 152);
                    HungerBar.SetSize(194, 16);
                    HungerBar.Anchors = Anchors.Height;
                    HungerBar.Visible = true;

                    HungerPercentLabel.SetPosition(161, 140);
                    HungerPercentLabel.SetSize(123, 40);
                    HungerPercentLabel.Anchors = Anchors.None;
                    HungerPercentLabel.Visible = true;

                    StaminaPercentLabel.SetPosition(161, 200);
                    StaminaPercentLabel.SetSize(123, 40);
                    StaminaPercentLabel.Anchors = Anchors.None;
                    StaminaPercentLabel.Visible = true;

                    StaminaBar.SetPosition(126, 212);
                    StaminaBar.SetSize(194, 16);
                    StaminaBar.Anchors = Anchors.Height;
                    StaminaBar.Visible = true;

                    StaminaLabel.SetPosition(0, 200);
                    StaminaLabel.SetSize(125, 41);
                    StaminaLabel.Anchors = Anchors.None;
                    StaminaLabel.Visible = true;

                    RunningPercentLabel.SetPosition(161, 259);
                    RunningPercentLabel.SetSize(123, 40);
                    RunningPercentLabel.Anchors = Anchors.None;
                    RunningPercentLabel.Visible = true;

                    RunningBar.SetPosition(126, 271);
                    RunningBar.SetSize(194, 16);
                    RunningBar.Anchors = Anchors.Height;
                    RunningBar.Visible = true;

                    RunLabel.SetPosition(0, 259);
                    RunLabel.SetSize(125, 41);
                    RunLabel.Anchors = Anchors.None;
                    RunLabel.Visible = true;

                    Display_Panel.SetPosition(20, 20);
                    Display_Panel.SetSize(340, 500);
                    Display_Panel.Anchors = Anchors.None;
                    Display_Panel.Visible = true;

                    break;
            }
            _currentLayoutOrientation = orientation;
        }

        public void UpdateLanguage()
        {
            StatsLabel.Text = "Stats";

            NameLabel.Text = "*** Name Goes Here ***";

            HungerLabel.Text = "Hunger:";

            HungerPercentLabel.Text = "hunger percent display";

            StaminaPercentLabel.Text = "Stamina percent display";

            StaminaLabel.Text = "Stamina:";

            RunningPercentLabel.Text = "Running percent display";

            RunLabel.Text = "Running:";
        }

        private void onShowing(object sender, EventArgs e)
        {
            switch (_currentLayoutOrientation)
            {
                case LayoutOrientation.Vertical:
                    Display_Panel.Visible = false;
                    break;

                default:
                    Display_Panel.Visible = false;
                    break;
            }
        }

        private void onShown(object sender, EventArgs e)
        {
            switch (_currentLayoutOrientation)
            {
                case LayoutOrientation.Vertical:
                    new FadeInEffect()
                    {
                        Widget = Display_Panel,
                    }.Start();
                    break;

                default:
                    new FadeInEffect()
                    {
                        Widget = Display_Panel,
                    }.Start();
                    break;
            }
        }

    }
}
